package com.sztest.jayjun.dialog;

/*

 */

import android.content.Context;
import android.util.Log;
import android.view.View;
import android.widget.RadioGroup;


import com.sztest.jayjun.R;
import com.sztest.jayjun.dialog.BaseDialog.Base2Dialog;
import com.sztest.jayjun.utils.LogUtils;

import androidx.annotation.NonNull;


public class SelectLanguageDialog extends Base2Dialog {
    private RadioGroup mRG;
    private boolean mSelectEn;

    public SelectLanguageDialog(@NonNull Context context) {
        super(context);
    }

    public SelectLanguageDialog(@NonNull Context context, int themeResId) {
        super(context, themeResId);
    }

    @Override
    protected int getlayoutId() {
        return R.layout.select_language_dialog;
    }

    @Override
    protected void initView() {
        findViewById(R.id.save).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                LogUtils.e("mselect"+mSelectEn);
                dismiss();
                if (mListener!=null) {
                    mListener.ensure();
                }
            }
        });
       mRG= findViewById(R.id.rg);
       mRG.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
           @Override
           public void onCheckedChanged(RadioGroup group, int checkedId) {
                if (checkedId==R.id.rbtn_en) {
                    mSelectEn=true;
                }else {
                    mSelectEn=false;
                }
           }
       });
    }
}
